import Mock from "mockjs2";
import { builder } from "../util";

const getClassInfo = () => {
  return builder([
    {
      id: 10001, //分类id
      name: "居家日用" //分类名称
    },
    {
      id: 10002,
      name: "美食"
    },
    {
      id: 10003,
      name: "母婴"
    },
    {
      id: 10004,
      name: "美妆"
    },
    {
      id: 10005,
      name: "女装"
    },
    {
      id: 10006,
      name: "数码家电"
    },
    {
      id: 10007,
      name: "文娱车品"
    },
    {
      id: 10008,
      name: "内衣"
    },
    {
      id: 10009,
      name: "家装家纺"
    },
    {
      id: 100010,
      name: "鞋品"
    },
    {
      id: 100011,
      name: "男装"
    },
    {
      id: 100012,
      name: "配饰"
    },
    {
      id: 100013,
      name: "户外运动"
    },
    {
      id: 100014,
      name: "箱包"
    },
    {
      id: 100015,
      name: "其他"
    }
  ]);
};

const getGoodsList = () => {
  return builder({
    page: 1,
    max_page: 1,
    data: [
      {
        id: 15, //商品id
        goods_name: "【明星同款】Champion带标 短袖T恤 经典刺秀 男女款", //商品名称
        nickname: "17339612793", //放单人昵称
        coupon_price: "0.00", // 优惠卷金额
        goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
        goods_price: "30.00", //商品价格
        after_coupon_price: "40.00", //卷后价格
        commission_than: "10", // 佣金比例
        coupon_collar_count: 1, // 优惠卷领取数量
        goods_day_num: 0, // 月销量
        coupon_num: 10, // 优惠卷总量
        shop_name: "测试店铺" //店铺名称
      },
      {
        id: 15, //商品id
        goods_name: "【明星同款】Champion带标 短袖T恤 经典刺秀 男女款", //商品名称
        nickname: "17339612793", //放单人昵称
        coupon_price: "0.00", // 优惠卷金额
        goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
        goods_price: "30.00", //商品价格
        after_coupon_price: "40.00", //卷后价格
        commission_than: "10", // 佣金比例
        coupon_collar_count: 1, // 优惠卷领取数量
        goods_day_num: 0, // 月销量
        coupon_num: 10, // 优惠卷总量
        shop_name: "测试店铺" //店铺名称
      },
      {
        id: 15, //商品id
        goods_name: "【明星同款】Champion带标 短袖T恤 经典刺秀 男女款", //商品名称
        nickname: "17339612793", //放单人昵称
        coupon_price: "0.00", // 优惠卷金额
        goods_img: require("@/assets/images/goodsimg.jpg"), //商品图片
        goods_price: "30.00", //商品价格
        after_coupon_price: "40.00", //卷后价格
        commission_than: "10", // 佣金比例
        coupon_collar_count: 1, // 优惠卷领取数量
        goods_day_num: 0, // 月销量
        coupon_num: 10, // 优惠卷总量
        shop_name: "测试店铺" //店铺名称
      }
    ]
  });
};

const getGoodsDetail = () => {
  return builder({
    goods_short_title: "【居家必备】纯棉加厚老粗布床单 2.0*2.3米", //商品短名称
    copywriting: "推广文案", //推广文案
    coupon_num: 10, //优惠卷总量
    goods_price: "30.00", //商品单价
    after_coupon_price: "40.00", //卷后单价
    coupon_collar_count: 0, //优惠卷领取数量
    goods_end_time: 1588516631, // 商品结束时间
    commission_than: "10", // 佣金比例
    goods_day_num: 0, //月销量
    goods_img: require("@/assets/images/goodsimg.jpg"), //商品主图
    goods_yx_img: require("@/assets/images/goodsimg.jpg"), //商品营销图
    coupon_remnant_num: 10 //优惠卷剩余数量
  });
};

Mock.mock(/\/local\/getClassInfo/, "get", getClassInfo);
Mock.mock(/\/local\/getGoodsList/, "post", getGoodsList);
Mock.mock(/\/local\/getGoodsDetail/, "post", getGoodsDetail);
